import { Component } from '@angular/core';
//import { lorem } from 'faker';



@Component({
  selector: 'app-root',
  templateUrl: './app.html',
  styleUrl: './app.css'
})
export class App {
  protected title = 'typing';

  //randomText = lorem.generate;
  randomText = "where are you from?";
  enteredText ='';

  onInput(value:string){
    this.enteredText = value;
  }

  compare(randomLetter:string,enteredLetter:string){
    if(!enteredLetter){
      return 'pending';
    }

    if(enteredLetter === randomLetter){
      return 'correct';
    }

    return randomLetter === enteredLetter ? 'correct' :' incorrect';
  }

  protected readonly indexedDB = indexedDB;
}
